/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package travelexperts;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "agencies", catalog = "travelexperts", schema = "")
@NamedQueries({
    @NamedQuery(name = "Agencies.findAll", query = "SELECT a FROM Agencies a"),
    @NamedQuery(name = "Agencies.findByAgencyId", query = "SELECT a FROM Agencies a WHERE a.agencyId = :agencyId"),
    @NamedQuery(name = "Agencies.findByAgncyAddress", query = "SELECT a FROM Agencies a WHERE a.agncyAddress = :agncyAddress"),
    @NamedQuery(name = "Agencies.findByAgncyCity", query = "SELECT a FROM Agencies a WHERE a.agncyCity = :agncyCity"),
    @NamedQuery(name = "Agencies.findByAgncyProv", query = "SELECT a FROM Agencies a WHERE a.agncyProv = :agncyProv"),
    @NamedQuery(name = "Agencies.findByAgncyPostal", query = "SELECT a FROM Agencies a WHERE a.agncyPostal = :agncyPostal"),
    @NamedQuery(name = "Agencies.findByAgncyCountry", query = "SELECT a FROM Agencies a WHERE a.agncyCountry = :agncyCountry"),
    @NamedQuery(name = "Agencies.findByAgncyPhone", query = "SELECT a FROM Agencies a WHERE a.agncyPhone = :agncyPhone"),
    @NamedQuery(name = "Agencies.findByAgncyFax", query = "SELECT a FROM Agencies a WHERE a.agncyFax = :agncyFax")})
public class Agencies implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "AgencyId")
    private Integer agencyId;
    @Column(name = "AgncyAddress")
    private String agncyAddress;
    @Column(name = "AgncyCity")
    private String agncyCity;
    @Column(name = "AgncyProv")
    private String agncyProv;
    @Column(name = "AgncyPostal")
    private String agncyPostal;
    @Column(name = "AgncyCountry")
    private String agncyCountry;
    @Column(name = "AgncyPhone")
    private String agncyPhone;
    @Column(name = "AgncyFax")
    private String agncyFax;

    public Agencies() {
    }

    public Agencies(Integer agencyId) {
        this.agencyId = agencyId;
    }

    public Integer getAgencyId() {
        return agencyId;
    }

    public void setAgencyId(Integer agencyId) {
        Integer oldAgencyId = this.agencyId;
        this.agencyId = agencyId;
        changeSupport.firePropertyChange("agencyId", oldAgencyId, agencyId);
    }

    public String getAgncyAddress() {
        return agncyAddress;
    }

    public void setAgncyAddress(String agncyAddress) {
        String oldAgncyAddress = this.agncyAddress;
        this.agncyAddress = agncyAddress;
        changeSupport.firePropertyChange("agncyAddress", oldAgncyAddress, agncyAddress);
    }

    public String getAgncyCity() {
        return agncyCity;
    }

    public void setAgncyCity(String agncyCity) {
        String oldAgncyCity = this.agncyCity;
        this.agncyCity = agncyCity;
        changeSupport.firePropertyChange("agncyCity", oldAgncyCity, agncyCity);
    }

    public String getAgncyProv() {
        return agncyProv;
    }

    public void setAgncyProv(String agncyProv) {
        String oldAgncyProv = this.agncyProv;
        this.agncyProv = agncyProv;
        changeSupport.firePropertyChange("agncyProv", oldAgncyProv, agncyProv);
    }

    public String getAgncyPostal() {
        return agncyPostal;
    }

    public void setAgncyPostal(String agncyPostal) {
        String oldAgncyPostal = this.agncyPostal;
        this.agncyPostal = agncyPostal;
        changeSupport.firePropertyChange("agncyPostal", oldAgncyPostal, agncyPostal);
    }

    public String getAgncyCountry() {
        return agncyCountry;
    }

    public void setAgncyCountry(String agncyCountry) {
        String oldAgncyCountry = this.agncyCountry;
        this.agncyCountry = agncyCountry;
        changeSupport.firePropertyChange("agncyCountry", oldAgncyCountry, agncyCountry);
    }

    public String getAgncyPhone() {
        return agncyPhone;
    }

    public void setAgncyPhone(String agncyPhone) {
        String oldAgncyPhone = this.agncyPhone;
        this.agncyPhone = agncyPhone;
        changeSupport.firePropertyChange("agncyPhone", oldAgncyPhone, agncyPhone);
    }

    public String getAgncyFax() {
        return agncyFax;
    }

    public void setAgncyFax(String agncyFax) {
        String oldAgncyFax = this.agncyFax;
        this.agncyFax = agncyFax;
        changeSupport.firePropertyChange("agncyFax", oldAgncyFax, agncyFax);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (agencyId != null ? agencyId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Agencies)) {
            return false;
        }
        Agencies other = (Agencies) object;
        if ((this.agencyId == null && other.agencyId != null) || (this.agencyId != null && !this.agencyId.equals(other.agencyId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "travelexperts.Agencies[ agencyId=" + agencyId + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
